package demo4;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

@Component
public class Person {
    /**
     * 该注解定义在属性上
     */
    @Autowired
    @Qualifier("winter")
    //private Shirt shirt;
    //private Sweater sweater;
    private Clothes clothes;//面向接口,人需要衣服,不是具体某种衣服

    @Override
    public String toString() {
        return "Person{" +
                "Clothes=" + clothes +
                '}';
    }
}
